package action.common;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import dao.common.EmployeeDao;
import dao.common.GoodsDao;
import model.common.Employee;
import model.common.Goods;

public class GoodsAction {
  
	private Goods goods;
	
	public void add(Goods goods) throws Exception{
		GoodsDao dao=new GoodsDao();
		dao.addGoods(goods);
	}
	
	public void get(Integer goodsId) throws Exception{
		GoodsDao dao=new GoodsDao();
		dao.get(goodsId);
	}
	
	public void edit(Goods goods) throws SQLException{
		GoodsDao dao=new GoodsDao();
		dao.updateGoods(goods);
	}
	
	public void del(Integer goodsId) throws SQLException{
		GoodsDao dao=new GoodsDao();
		dao.deleteGoods(goodsId);
	}
	
	public List<Goods> query(List<Map<String, Object>> params) throws Exception{
		GoodsDao dao=new GoodsDao();
		
		return dao.query(params);
		
	}
	
	public List<Goods> query(String goodsName,String goodsPrice) throws Exception{
		GoodsDao dao=new GoodsDao();
		return dao.query(goodsName, goodsPrice);
		
	}
	
}
